const MongoClient = require('mongodb').MongoClient;
const url = 'mongodb://localhost:27017/amg';
MongoClient.connect(url,function(err,db){
    if(!err){
        const collection = db.collection('amg');
        collection.find({"name":"nihao"}).toArray(function(err,result){
            if(!err){
                    console.log(result);
            }
        })
    }
    db.close();
})
